//封装的工具函数


import axios from "axios"

axios.defaults.baseURL = "http://localhost:5000"

export default axios

//转化为年月日时间
export let conversionTime = (utctime) => {
    let d = new Date(utctime)
    // console.log( d )
    return d.getFullYear() + "-" + addZero(d.getMonth() + 1) + "-" + addZero(d.getDate())+" "+addZero(d.getHours())+":"+addZero(d.getMinutes())+":"+addZero(d.getSeconds())
    
}

//补零函数
let addZero = (val) => val<10?"0"+val:val
